import React from 'react';
import moment from 'moment';
import { Avatar } from 'antd';
import styles from './index.less';
import Ellipsis from '@/components/Ellipsis';

const CrowdActivityCenter = ({
  data: { center, createdAt, start_time, headimgurl, nick_name, href },
}) => {
  return (
    <div className={styles.listContent}>
      <div className={styles.description}>
        <Ellipsis lines={1}>{center}</Ellipsis>
      </div>
      <div className={styles.extra}>
        发布人：
        <Avatar src={headimgurl} size="small" />
        <a href={href}>{nick_name}</a>
        <em>发布时间：{moment(createdAt).format('YYYY-MM-DD HH:mm')}</em>
        <em>活动开始时间：{moment(start_time).format('YYYY-MM-DD HH:mm')}</em>
      </div>
    </div>
  );
};

export default CrowdActivityCenter;
